package com.zzsy.shoppingpro.http;

import com.zzsy.shoppingpro.basebean.BaseBean;

import io.reactivex.Observer;


/**
 * HTTP请求回调的基类
 * Created by JinZhenkun on 2016/10/28.
 */

public abstract class BaseCallback<T extends BaseBean> implements Observer<T> {

    @Override
    public void onNext(T t) {
        success(t);
    }

    @Override
    public void onError(Throwable e) {
        if(e != null){
            e.printStackTrace();
        }
    }

    /**
     * 服务端返回成功
     * @param t 响应数据
     */
    public abstract void success(T t);
}
